<template>
  <div class="b-trial-pop" :class="{ show: isShow, [placement]: true }">
    <div class="b-trial-pop__header">
      <i class="el-icon-warning"></i>
      <div class="title">系统提示</div>
      <i class="el-icon-close" @click="isShow = false"></i>
    </div>
    <div class="b-trial-pop__body">
      <div class="content">
        感谢您使用xxxx出品的软件，您现在使用的是试用版，请联系我公司客服激活正式版。
      </div>
      <div class="btns">
        <img class="wcode" src="" alt="" />
        <div class="text">扫码联系客服</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "bTrialPop",
  props: {
    placement: {
      type: String,
      default: "rb",
    },
  },
  data() {
    return {
      isShow: false,
    };
  },
  mounted() {
    setTimeout(() => {
      if (JSON.parse(process.env.VITE_TRIAL || 'false') === true) {
        this.isShow = true;
      } else {
        this.isShow = false;
      }
    }, 0);
  },
};
</script>

<style lang="scss" scoped>
.b-trial-pop {
  width: 0px;
  background: #ffffff;
  box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.08);
  border-radius: 4px 4px 4px 4px;
  position: fixed;
  z-index: 99999;
  &.show {
    width: 490px;
    transition: width 0.3s ease;
  }
  &.lt {
    top: 8px;
    left: 8px;
  }
  &.lb {
    bottom: 8px;
    left: 8px;
  }
  &.rt {
    top: 8px;
    right: 8px;
  }
  &.rb {
    bottom: 8px;
    right: 8px;
  }
  &__header {
    padding: 11px 24px 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(112, 112, 112, 0.08);
    .title {
      font-weight: bold;
      font-size: 18px;
      color: #000000;
      margin-left: 8px;
      margin-right: auto;
    }
    .el-icon-warning {
      color: #f96060;
      font-size: 20px;
    }
    .el-icon-close {
      color: #DBDBDB;
      font-size: 24px;
      cursor: pointer;
      &:hover {
        opacity: 0.5;
      }
    }
  }
  &__body {
    padding: 16px 24px 24px 24px;
    display: flex;
    .content {
      height: 109px;
      border-radius: 4px 4px 4px 4px;
      border: 1px solid #4178c9;
      padding: 20px 24px;
      font-weight: 400;
      font-size: 16px;
      color: #000000;
      line-height: 22px;
    }
    .btns {
      margin-left: 24px;
      text-align: center;
      .wcode {
        height: 70px;
        width: auto;
      }
      .text {
        margin-top: 8px;
        background: #4178c9;
        border-radius: 4px 4px 4px 4px;
        font-weight: 400;
        font-size: 14px;
        color: #ffffff;
        width: 108px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
      }
    }
  }
}
</style>
